package com.atguigu.cloud.order.controller;

import com.atguigu.cloud.order.entity.Order;
import com.atguigu.cloud.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Taeyang
 * @date 2025/4/4
 */
@RestController
@RequestMapping("/api/order")
@Slf4j
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping(value = "/findOrderByOrderId/{orderId}")
    public Order findOrderByOrderId(@PathVariable("orderId") Long orderId, @RequestHeader(name = "Truth") String header) {

        log.info("findOrderByOrderId请求头：" + header);

        return orderService.findOrderByOrderId(orderId, header);
    }
}
